const express = require('express');
const router = express.Router();
const pool = require('../database/db'); // 数据库连接池
const OrderController = require('../controller/OrderController');

const orderController = new OrderController(pool);
router.get('/', (req, res) => orderController.getUserOrders(req, res));
router.post('/purchase', (req, res) => orderController.addPurchaseOrder(req, res));
router.post('/supply', (req, res) => orderController.addSupplyOrder(req, res));

module.exports = router;
